Style improvement & bug fixes