Fixed wrong results return on error