Fixing some syntax errors, returning multiple values if nil