Bug fix, improved comments