[fix] [patch] fixes bad stock entries due to a bug introduced in commit c46d044efe8f696cf411b69864046dc0e26e776f