Bug fixes and pin assignment