bug fixes and tweaks for foundation 5