Fix some broken tests for Wildfly

Also simplify some of the error stuff, as it was causing problems