fix bugs found by travis