Fixed "a" and "d" bug