Fix for nested functions?