Fix bugs and rearrange properties.