Fixing implementation bugs