Added a missing error case

I forgot to test for the type error; which was still using
a Maybe.

This cased the queryM function to return a Nothing on error
instead of using return_type.fail().