Fixed const-correctness with custom objects pointers

Fixed and added tests for #7