Added "return offset;" to end of generated function.