Added more returns for functions

Some couldnt succeed and others didnt fail as they should.