Tests added & bug fixed