Fixes comments and adds tests