Stub generation fixes