Fixed some runtime issues