Add specs, Travis-CI and fix a few bugs