Fixed tests and added the returning of status codes when running tests