Fixed previously unnoticed bug