Added test serial and fixed bugs