Fixes issues with code