Bug fixes and other design tweaks