Cast stdClass before attempting to overload $bp global

See #26. Props imath