BOY: Fixed NullPointer exceptions

Resolves #310