Fixed exception

Resolves #278