Fixing bug where annotated prefect and permission functions threw exceptions