Fixed a bug preventing functions from being properlyl generated