Fixing dynamic calculations