Fixing end* statments