Fix parenthesis and undefined variable
Merge pull request #784 from Sulcata/master

More organization. Less crashing hopefully.