core bug fixes