Better errors
Fix bug when creating resutls