Fix dereferencing const ref_ptr's (closes #143)