Fix broken Travis build and code cleanup

This fixes a broken build in Travis.  PR also includes some code cleanup.

cc: @jjmerino, @kmeurer, @jamesongamble, @suprbh