Fixing a bug, making things more readable