Problem with Loiter Mode with PX4Flow

Hi,

I have been flying my Pixhawk drone and trying to get optical flow position hold working. Following the Ardupilot instructions here http://ardupilot.org/copter/docs/common-px4flow-overview.html, I verified that my OF readings were correlated with the IMU readings and have been trying to switch to loiter mode to test the position hold. However, I frequently lose control of the drone within a few seconds of flying in loiter (tried both switching after taking off in stabilize, and starting off in loiter) and the drone ends up veering sharply to one side and crashing.

I would appreciate if anybody had some tips on how I could troubleshoot this!

Here are my logs (loiter crash at the end) and param files
loitercrash_param.param (13.2 KB)