Added more and corrected tests + one more bug fix

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>