Fixes problems in code