Take changes from #1351 and apply to 3.0
Note: array binding is now working