Fix some bugs due to sleepiness