Resolve #48 + small mysql fix