changed size argument type from gulong to gsize as discussed on