Compile time warnings

Some compile time warnings occurred. Solutions have been added for these cases, somewhat categorized. 
Also, the method probably shouldn't accept `null` for that arg.