error cleanup, fix pin numbering