Fixed bug while removing function calls