Fixed context issue and missing break statement

Hey J,

This is my very first attempt at a pull request, so i hope I've done everything right.