This does not work when run from the commandline, see failing tests