Fix null value problem and add meaningful test asserts. Closes #24