Fixed bugs in function getRestrictions.