Removed a few unneeded casts and some whitespace cleanup as well