Added some compiler warning flags and corrected some (performance) issues.