Fixed Errors in code