Slightly better error-handling, testing still doesn't work