cleanups

*minor changes to port manipulation code
*cleanups in button debug function