fixed bugs, introduced tests
Merge branch 'master' of https://github.com/SWTI2014/SWTI2014-Project-03