Added V5.1 support, XEBEC support, and fixed some bugs.