Fixed crash due to arguments count assertion. Closes #470 and #472.