Minor bugfix & cleanup