Bug fix & test