Better error checking and more coffeescript-like syntax