Remove 2 pending from specs and fix lib code to make specs pass.
Merge pull request #303 from jonas054/fix_pending

Remove 2 pending from specs and fix lib code to make specs pass.