Made minor changes in code to make things work

Thanks to Merlano Trevis