Fix some problem with Monocle and add unit test. re #52