Fixed log and runtime error