Fixed some bugs in NCX command. Now can work properly. Need more testing
and debugging.