Upgrade to 3.1.0.M1
Workaround for bug in 3.1.0.M1 and small fixes