Merge "Added error check for output buffer size." into FPIIM_WIP