Minor bug fixed

When testing found some small bugs. Fixed now.