Bugfix

Resolved issue where exception was always being thrown.