Fixed undefined variable error and tested in travis-ci

I setup travis-ci instance for my local fork to prevent silly errors like this from happening again. This one passed travis-ci