Can't get / set collapsible property 'collapsed'

Can't get / set collapsible property 'collapsed'

Hello,
according to docs this should tell me if a collapsible is collapsed:
  1. var collapsed = $("#MyCollapsible").collapsible("option", "collapsed")
but I always get the value of the data-collapsed attribute set in the original HTML, not the current state.
And this should set the state:
  1. $("#MyCollapsible").collapsible("option", "collapsed", true) // or false
but has no effects.
Instead I'm doing this way, and it works:
  1. var collapsed = $("#MyCollapsible").hasClass("ui-collapsible-collapsed")
  2. $("#MyCollapsible").trigger(collapsed ? "collapse" : "expand") 
Is this a bug of version 1.3.1 or am I doing something wrong?