Bug fixes for last commits