fixed jsperf warrnings
fixed due to jshint results
Fixed issues unvailed by codereview and jshint