Fixed a bug:
  The order of setting properties is incorrect.