Fixed wrong sandbox behavior in C extension, fixed #1254