Fixed memory errors. Made target Atmel 87F51RC.