fixed ensureSafeObject function
0.1.1