Fix database length issue, #11