Fixed bug with advanced features from previous commit