bug fixes, clean up, initial support of NFC