Fixed missing argument and undef var warnings.