#283 cleanup and better error message