fixed issue with broken test and fixed function leading to travis build failing